﻿using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;

namespace ParticlePlayground
{
	// Token: 0x02000152 RID: 338
	[ExecuteInEditMode]
	public class PlaygroundTrails : MonoBehaviour
	{
		// Token: 0x0600075F RID: 1887 RVA: 0x0002B770 File Offset: 0x00029970
		public virtual void OnEnable()
		{
			if (this.playgroundSystem == null)
			{
				this.playgroundSystem = base.GetComponent<PlaygroundParticlesC>();
			}
			if (this.billboardTransform == null)
			{
				this.billboardTransform = Camera.main.transform;
			}
			if (this.material == null)
			{
				this.material = new Material(Shader.Find("Playground/Vertex Color"));
				this._materialCache = this.material;
			}
			this.ResetTrails();
			this.AddRequiredParticleEvents();
			if (this.timeWidth == null)
			{
				this.timeWidth = new AnimationCurve(this.DefaultWidthKeys());
			}
			if (this.pointArrayAlpha == null)
			{
				this.pointArrayAlpha = new AnimationCurve(this.DefaultWidthKeys());
			}
			this._isDoneThread = true;
		}

		// Token: 0x06000760 RID: 1888 RVA: 0x0002B838 File Offset: 0x00029A38
		public virtual void OnDisable()
		{
			this.DestroyAllTrails();
			this.RemoveRequiredEvents();
		}

		// Token: 0x06000761 RID: 1889 RVA: 0x0002B848 File Offset: 0x00029A48
		public virtual void OnDestroy()
		{
			this.DestroyAllTrails();
			this.RemoveRequiredEvents();
		}

		// Token: 0x06000762 RID: 1890 RVA: 0x0002B858 File Offset: 0x00029A58
		public virtual void Update()
		{
			this.maxPoints = Mathf.Clamp(this.maxPoints, 2, 32767);
			if (this.billboardTransform != null)
			{
				this._billboardTransformPosition = this.billboardTransform.position;
			}
			if (this.playgroundSystem == null || !this.playgroundSystem.IsReady() || this.playgroundSystem.IsSettingParticleCount() || this.playgroundSystem.IsSettingLifetime() || this.playgroundSystem.particleCache == null || this.playgroundSystem.particleCache.Length == 0)
			{
				return;
			}
			if (this._currentParticleCount != this.playgroundSystem.particleCount || this._currentParticleMinLifetime != this.playgroundSystem.lifetimeMin || this._currentParticleMaxLifetime != this.playgroundSystem.lifetime || this._localSpace != (this.playgroundSystem.shurikenParticleSystem.simulationSpace == ParticleSystemSimulationSpace.Local))
			{
				this.ResetTrails();
			}
			if (this._localSpace)
			{
				this._localMatrix.SetTRS(this.playgroundSystem.particleSystemTransform.position, this.playgroundSystem.particleSystemTransform.rotation, this.playgroundSystem.particleSystemTransform.lossyScale);
			}
			if (this.material != this._materialCache)
			{
				this.SetMaterial(this.material);
			}
			if (this._isDoneThread)
			{
				for (int i = 0; i < this._trails.Count; i++)
				{
					if (this._trails[i].trailPoints != null && this._trails[i].trailPoints.Count > 1 && this._trails[i].trailPoints[this._trails[i].trailPoints.Count - 1] != null && this._trails[i].CanRemoveTrail())
					{
						this.RemoveTrail(i);
						i--;
						if (i < 0)
						{
							i = 0;
						}
					}
				}
			}
			while (this._birthQueue.Count > 0)
			{
				this.AddTrail(this._birthQueue.Dequeue());
			}
			for (int j = 0; j < this._trails.Count; j++)
			{
				ParticlePlaygroundTrail particlePlaygroundTrail = this._trails[j];
				particlePlaygroundTrail.trailRenderer.receiveShadows = this.receiveShadows;
				particlePlaygroundTrail.trailRenderer.shadowCastingMode = this.shadowCastingMode;
				if (this._isDoneThread)
				{
					particlePlaygroundTrail.UpdateMesh();
				}
			}
			if (this.multithreading)
			{
				if (this._isDoneThread)
				{
					this._calculationStartTime = ((!Application.isPlaying) ? Time.realtimeSinceStartup : Time.time);
					this._isDoneThread = false;
					PlaygroundC.RunAsync(delegate()
					{
						object locker = this._locker;
						lock (locker)
						{
							if (!this._isDoneThread)
							{
								this.CalculateTrail();
								this._isDoneThread = true;
							}
						}
					});
				}
			}
			else
			{
				this._calculationStartTime = ((!Application.isPlaying) ? Time.realtimeSinceStartup : Time.time);
				this.CalculateTrail();
			}
		}

		// Token: 0x06000763 RID: 1891 RVA: 0x0002BB88 File Offset: 0x00029D88
		public virtual void OnParticleBirthEvent(PlaygroundEventParticle particle)
		{
			this._birthQueue.Enqueue(new TrailParticleInfo(particle.particleId, particle.position, particle.velocity));
		}

		// Token: 0x06000764 RID: 1892 RVA: 0x0002BBAC File Offset: 0x00029DAC
		public virtual void OnParticleDeathEvent(PlaygroundEventParticle particle)
		{
			int oldestTrailWithParticleId = this.GetOldestTrailWithParticleId(particle.particleId);
			if (oldestTrailWithParticleId > -1)
			{
				if (this.createLastPointOnParticleDeath)
				{
					this._trails[oldestTrailWithParticleId].SetLastPoint(particle.position, particle.velocity, this.EvaluateWidth(0f), this.time, this._calculationStartTime);
				}
				else
				{
					this._trails[oldestTrailWithParticleId].SetParticlePosition(particle.position);
					this._trails[oldestTrailWithParticleId].Die();
				}
			}
		}

		// Token: 0x06000765 RID: 1893 RVA: 0x0002BC3C File Offset: 0x00029E3C
		public virtual void OnParticleCollisionEvent(PlaygroundEventParticle particle)
		{
			if (this.createPointsOnCollision)
			{
				int newestTrailWithParticleId = this.GetNewestTrailWithParticleId(particle.particleId);
				if (newestTrailWithParticleId < 0)
				{
					return;
				}
				ParticlePlaygroundTrail particlePlaygroundTrail = this._trails[newestTrailWithParticleId];
				particlePlaygroundTrail.AddPoint(this.playgroundSystem.particleCache[particle.particleId].position, this.EvaluateWidth(0f), this.time, this._calculationStartTime);
			}
		}

		// Token: 0x06000766 RID: 1894 RVA: 0x0002BCB0 File Offset: 0x00029EB0
		public virtual PlaygroundEventC GetBirthEvent()
		{
			return this.birthEvent;
		}

		// Token: 0x06000767 RID: 1895 RVA: 0x0002BCB8 File Offset: 0x00029EB8
		public virtual PlaygroundEventC GetDeathEvent()
		{
			return this.deathEvent;
		}

		// Token: 0x06000768 RID: 1896 RVA: 0x0002BCC0 File Offset: 0x00029EC0
		public virtual PlaygroundEventC GetCollisionEvent()
		{
			return this.collisionEvent;
		}

		// Token: 0x06000769 RID: 1897 RVA: 0x0002BCC8 File Offset: 0x00029EC8
		public virtual void AddRequiredParticleEvents()
		{
			if (this.playgroundSystem != null)
			{
				this.birthEvent = this.GetEventFromType(EVENTTYPEC.Birth);
				if (this.birthEvent == null)
				{
					this.birthEvent = PlaygroundC.CreateEvent(this.playgroundSystem);
					this.birthEvent.broadcastType = EVENTBROADCASTC.EventListeners;
					this.birthEvent.eventType = EVENTTYPEC.Birth;
				}
				this.birthEvent.particleEvent += this.OnParticleBirthEvent;
				this.deathEvent = this.GetEventFromType(EVENTTYPEC.Death);
				if (this.deathEvent == null)
				{
					this.deathEvent = PlaygroundC.CreateEvent(this.playgroundSystem);
					this.deathEvent.broadcastType = EVENTBROADCASTC.EventListeners;
					this.deathEvent.eventType = EVENTTYPEC.Death;
				}
				this.deathEvent.particleEvent += this.OnParticleDeathEvent;
				this.collisionEvent = this.GetEventFromType(EVENTTYPEC.Collision);
				if (this.collisionEvent == null)
				{
					this.collisionEvent = PlaygroundC.CreateEvent(this.playgroundSystem);
					this.collisionEvent.broadcastType = EVENTBROADCASTC.EventListeners;
					this.collisionEvent.eventType = EVENTTYPEC.Collision;
				}
				this.collisionEvent.particleEvent += this.OnParticleCollisionEvent;
			}
		}

		// Token: 0x0600076A RID: 1898 RVA: 0x0002BDF0 File Offset: 0x00029FF0
		public virtual void RemoveRequiredEvents()
		{
			if (this.playgroundSystem != null)
			{
				if (this.birthEvent != null)
				{
					this.birthEvent.particleEvent -= this.OnParticleBirthEvent;
					this.birthEvent = null;
				}
				if (this.deathEvent != null)
				{
					this.deathEvent.particleEvent -= this.OnParticleDeathEvent;
					this.deathEvent = null;
				}
				if (this.collisionEvent != null)
				{
					this.collisionEvent.particleEvent -= this.OnParticleCollisionEvent;
					this.collisionEvent = null;
				}
			}
		}

		// Token: 0x0600076B RID: 1899 RVA: 0x0002BE8C File Offset: 0x0002A08C
		public virtual PlaygroundEventC GetEventFromType(EVENTTYPEC eventType)
		{
			for (int i = 0; i < this.playgroundSystem.events.Count; i++)
			{
				if (this.playgroundSystem.events[i].eventType == eventType)
				{
					return this.playgroundSystem.events[i];
				}
			}
			return null;
		}

		// Token: 0x0600076C RID: 1900 RVA: 0x0002BEEC File Offset: 0x0002A0EC
		public virtual Keyframe[] DefaultWidthKeys()
		{
			Keyframe[] array = new Keyframe[2];
			array[0].time = 0f;
			array[1].time = 1f;
			array[0].value = 1f;
			array[1].value = 1f;
			return array;
		}

		// Token: 0x0600076D RID: 1901 RVA: 0x0002BF48 File Offset: 0x0002A148
		public virtual void SetMaterial(Material material)
		{
			for (int i = 0; i < this._trails.Count; i++)
			{
				if (this._trails[i] != null && this._trails[i].trailRenderer != null)
				{
					this._trails[i].trailRenderer.sharedMaterial = material;
				}
			}
			this._materialCache = material;
		}

		// Token: 0x0600076E RID: 1902 RVA: 0x0002BFBC File Offset: 0x0002A1BC
		public virtual float EvaluateWidth(float normalizedTime)
		{
			return this.timeWidth.Evaluate(normalizedTime) * this.widthScale;
		}

		// Token: 0x0600076F RID: 1903 RVA: 0x0002BFD4 File Offset: 0x0002A1D4
		public virtual Color32 EvaluateColor(float normalizedTime)
		{
			return this.lifetimeColor.Evaluate(normalizedTime);
		}

		// Token: 0x06000770 RID: 1904 RVA: 0x0002BFE8 File Offset: 0x0002A1E8
		public virtual Color32 EvaluateColor(int trailIndex, int trailPointIndex)
		{
			return this.lifetimeColor.Evaluate((float)trailPointIndex * 1f / (float)(this._trails[trailIndex].GetBirthIterator() - 1));
		}

		// Token: 0x06000771 RID: 1905 RVA: 0x0002C018 File Offset: 0x0002A218
		public virtual void AddTrail(TrailParticleInfo particleInfo)
		{
			if (this._parentGameObject == null)
			{
				this._parentGameObject = new GameObject("Playground Trails (" + this.playgroundSystem.name + ")", new Type[]
				{
					typeof(global::PlaygroundTrailParent)
				});
				this._parentTransform = this._parentGameObject.transform;
				this._parentGameObject.GetComponent<global::PlaygroundTrailParent>().trailsReference = this;
			}
			ParticlePlaygroundTrail particlePlaygroundTrail = new ParticlePlaygroundTrail(this.maxPoints);
			particlePlaygroundTrail.trailGameObject = new GameObject("Playground Trail " + particleInfo.particleId);
			particlePlaygroundTrail.trailTransform = particlePlaygroundTrail.trailGameObject.transform;
			particlePlaygroundTrail.trailTransform.parent = this._parentTransform;
			particlePlaygroundTrail.trailRenderer = particlePlaygroundTrail.trailGameObject.AddComponent<MeshRenderer>();
			particlePlaygroundTrail.trailMeshFilter = particlePlaygroundTrail.trailGameObject.AddComponent<MeshFilter>();
			particlePlaygroundTrail.trailMesh = new Mesh();
			particlePlaygroundTrail.trailMesh.MarkDynamic();
			particlePlaygroundTrail.trailMeshFilter.sharedMesh = particlePlaygroundTrail.trailMesh;
			particlePlaygroundTrail.trailRenderer.sharedMaterial = this.material;
			particlePlaygroundTrail.particleId = particleInfo.particleId;
			if (this.createFirstPointOnParticleBirth)
			{
				particlePlaygroundTrail.SetFirstPoint(particleInfo.position, particleInfo.velocity, this.EvaluateWidth(0f), this.time, this._calculationStartTime);
			}
			this._trails.Add(particlePlaygroundTrail);
		}

		// Token: 0x06000772 RID: 1906 RVA: 0x0002C188 File Offset: 0x0002A388
		public virtual int GetOldestTrailWithParticleId(int particleId)
		{
			for (int i = 0; i < this._trails.Count; i++)
			{
				if (this._trails[i].particleId == particleId && !this._trails[i].IsDead())
				{
					return i;
				}
			}
			return -1;
		}

		// Token: 0x06000773 RID: 1907 RVA: 0x0002C1E4 File Offset: 0x0002A3E4
		public virtual int GetNewestTrailWithParticleId(int particleId)
		{
			for (int i = this._trails.Count - 1; i >= 0; i--)
			{
				if (this._trails[i].particleId == particleId && !this._trails[i].IsDead())
				{
					return i;
				}
			}
			return -1;
		}

		// Token: 0x06000774 RID: 1908 RVA: 0x0002C240 File Offset: 0x0002A440
		public virtual Transform GetParentTransform()
		{
			return this._parentTransform;
		}

		// Token: 0x06000775 RID: 1909 RVA: 0x0002C248 File Offset: 0x0002A448
		public virtual GameObject GetParentGameObject()
		{
			return this._parentGameObject;
		}

		// Token: 0x06000776 RID: 1910 RVA: 0x0002C250 File Offset: 0x0002A450
		public virtual void StopTrail(int trailNumber)
		{
			if (trailNumber < 0)
			{
				return;
			}
			this._trails[trailNumber].Die();
		}

		// Token: 0x06000777 RID: 1911 RVA: 0x0002C26C File Offset: 0x0002A46C
		public virtual void StopOldestTrailWithParticleId(int particleId)
		{
			this.StopTrail(this.GetOldestTrailWithParticleId(particleId));
		}

		// Token: 0x06000778 RID: 1912 RVA: 0x0002C27C File Offset: 0x0002A47C
		public virtual void StopNewestTrailWithParticleId(int particleId)
		{
			this.StopTrail(this.GetNewestTrailWithParticleId(particleId));
		}

		// Token: 0x06000779 RID: 1913 RVA: 0x0002C28C File Offset: 0x0002A48C
		public virtual void ResetTrails()
		{
			this.DestroyAllTrails();
			if (this.playgroundSystem != null && base.gameObject.activeInHierarchy)
			{
				this._currentParticleCount = this.playgroundSystem.particleCount;
				this._currentParticleMinLifetime = this.playgroundSystem.lifetimeMin;
				this._currentParticleMaxLifetime = this.playgroundSystem.lifetime;
				this._localSpace = (this.playgroundSystem.shurikenParticleSystem.simulationSpace == ParticleSystemSimulationSpace.Local);
			}
			this._isDoneThread = true;
		}

		// Token: 0x0600077A RID: 1914 RVA: 0x0002C314 File Offset: 0x0002A514
		public virtual void RemoveTrail(int index)
		{
			if (Application.isPlaying)
			{
				UnityEngine.Object.Destroy(this._trails[index].trailGameObject);
			}
			else
			{
				UnityEngine.Object.DestroyImmediate(this._trails[index].trailGameObject);
			}
			this._trails.RemoveAt(index);
		}

		// Token: 0x0600077B RID: 1915 RVA: 0x0002C368 File Offset: 0x0002A568
		public virtual void DestroyAllTrails()
		{
			foreach (ParticlePlaygroundTrail particlePlaygroundTrail in this._trails)
			{
				if (Application.isPlaying)
				{
					UnityEngine.Object.Destroy(particlePlaygroundTrail.trailGameObject);
				}
				else
				{
					UnityEngine.Object.DestroyImmediate(particlePlaygroundTrail.trailGameObject);
				}
			}
			if (this._parentGameObject != null)
			{
				if (Application.isPlaying)
				{
					UnityEngine.Object.Destroy(this._parentGameObject);
				}
				else
				{
					UnityEngine.Object.DestroyImmediate(this._parentGameObject);
				}
			}
			this._trails.Clear();
			this._birthQueue.Clear();
		}

		// Token: 0x0600077C RID: 1916 RVA: 0x0002C42C File Offset: 0x0002A62C
		public virtual void CalculateTrail()
		{
			for (int i = 0; i < this._trails.Count; i++)
			{
				ParticlePlaygroundTrail particlePlaygroundTrail = this._trails[i];
				if (!particlePlaygroundTrail.CanRemoveTrail())
				{
					if (particlePlaygroundTrail.particleId >= 0 && !particlePlaygroundTrail.IsDead())
					{
						if (particlePlaygroundTrail.GetBirthIterator() > 0)
						{
							float num = Vector3.Distance(particlePlaygroundTrail.GetParticlePosition(), particlePlaygroundTrail.GetLastAddedPointPosition());
							if (num > this.minVertexDistance)
							{
								float pathDeviation = particlePlaygroundTrail.GetPathDeviation();
								if (num > this.maxVertexDistance || pathDeviation > this.maxPathDeviation)
								{
									particlePlaygroundTrail.AddPoint(this.playgroundSystem.particleCache[particlePlaygroundTrail.particleId].position, this.EvaluateWidth(0f), this.time, this._calculationStartTime);
								}
							}
						}
						else
						{
							particlePlaygroundTrail.SetFirstPoint(this.playgroundSystem.particleCache[particlePlaygroundTrail.particleId].position, this.playgroundSystem.particleCache[particlePlaygroundTrail.particleId].velocity, this.EvaluateWidth(0f), this.time, this._calculationStartTime);
						}
						particlePlaygroundTrail.SetParticlePosition(this.playgroundSystem.particleCache[particlePlaygroundTrail.particleId].position);
					}
					int j = 0;
					while (j < particlePlaygroundTrail.trailPoints.Count)
					{
						TrailPoint trailPoint = particlePlaygroundTrail.trailPoints[j];
						if (!trailPoint.CanRemove())
						{
							goto IL_170;
						}
						particlePlaygroundTrail.RemovePoint(j);
						if (this._localSpace)
						{
							goto IL_170;
						}
						IL_3F4:
						j++;
						continue;
						IL_170:
						float normalizedLifetime = trailPoint.GetNormalizedLifetime();
						trailPoint.Update(this._calculationStartTime, this.EvaluateWidth(normalizedLifetime));
						if (!particlePlaygroundTrail.IsDead() && j == particlePlaygroundTrail.trailPoints.Count - 1)
						{
							trailPoint.position = particlePlaygroundTrail.GetParticlePosition();
						}
						Vector3 vector = trailPoint.position;
						Vector3 vector2 = (j >= particlePlaygroundTrail.trailPoints.Count - 1) ? (vector + (vector - particlePlaygroundTrail.trailPoints[j - 1].position)) : particlePlaygroundTrail.trailPoints[j + 1].position;
						Vector3 lhs = Vector3.up;
						switch (this.renderMode)
						{
						case TrailRenderMode.Billboard:
							lhs = (this._billboardTransformPosition - vector).normalized;
							break;
						case TrailRenderMode.Vertical:
							lhs = Vector3.forward;
							break;
						}
						if (this._localSpace)
						{
							vector = this._localMatrix.MultiplyPoint3x4(vector);
							vector2 = this._localMatrix.MultiplyPoint3x4(vector2);
						}
						Vector3 a = (this.renderMode == TrailRenderMode.CustomRenderScale) ? this.customRenderScale : Vector3.Cross(lhs, vector2 - vector).normalized;
						Vector3 vector3 = vector + a * (trailPoint.width * 0.5f);
						Vector3 vector4 = vector - a * (trailPoint.width * 0.5f);
						particlePlaygroundTrail.meshVerticesCache[j * 2] = vector3;
						particlePlaygroundTrail.meshVerticesCache[j * 2 + 1] = vector4;
						float x = (this.uvMode != TrailUvMode.Lifetime) ? ((float)j * 1f / (float)(particlePlaygroundTrail.GetBirthIterator() - 1)) : normalizedLifetime;
						particlePlaygroundTrail.meshUvsCache[j * 2] = new Vector2(x, 0f);
						particlePlaygroundTrail.meshUvsCache[j * 2 + 1] = new Vector2(x, 1f);
						if (this.colorMode == TrailColorMode.Lifetime)
						{
							Color32 color = this.EvaluateColor(normalizedLifetime);
							color.a = (byte)((float)color.a * this.pointArrayAlpha.Evaluate((float)j * 1f / (float)(particlePlaygroundTrail.GetBirthIterator() - 1)));
							particlePlaygroundTrail.SetColor(j, color);
							goto IL_3F4;
						}
						particlePlaygroundTrail.SetColor(j, this.EvaluateColor(i, j));
						goto IL_3F4;
					}
				}
			}
		}

		// Token: 0x0400076E RID: 1902
		[HideInInspector]
		public PlaygroundParticlesC playgroundSystem;

		// Token: 0x0400076F RID: 1903
		[HideInInspector]
		public Material material;

		// Token: 0x04000770 RID: 1904
		[HideInInspector]
		public Gradient lifetimeColor = new Gradient();

		// Token: 0x04000771 RID: 1905
		[HideInInspector]
		public AnimationCurve pointArrayAlpha;

		// Token: 0x04000772 RID: 1906
		[HideInInspector]
		public TrailColorMode colorMode;

		// Token: 0x04000773 RID: 1907
		[HideInInspector]
		public TrailUvMode uvMode;

		// Token: 0x04000774 RID: 1908
		[HideInInspector]
		public TrailRenderMode renderMode;

		// Token: 0x04000775 RID: 1909
		[HideInInspector]
		public Transform billboardTransform;

		// Token: 0x04000776 RID: 1910
		[HideInInspector]
		public Vector3 customRenderScale = Vector3.one;

		// Token: 0x04000777 RID: 1911
		[HideInInspector]
		public bool receiveShadows;

		// Token: 0x04000778 RID: 1912
		[HideInInspector]
		public ShadowCastingMode shadowCastingMode;

		// Token: 0x04000779 RID: 1913
		[HideInInspector]
		public float time = 3f;

		// Token: 0x0400077A RID: 1914
		public AnimationCurve timeWidth;

		// Token: 0x0400077B RID: 1915
		public float widthScale = 0.1f;

		// Token: 0x0400077C RID: 1916
		public float minVertexDistance = 0.1f;

		// Token: 0x0400077D RID: 1917
		public float maxVertexDistance = 100f;

		// Token: 0x0400077E RID: 1918
		public float maxPathDeviation = 1f;

		// Token: 0x0400077F RID: 1919
		public bool createPointsOnCollision;

		// Token: 0x04000780 RID: 1920
		public int maxPoints = 100;

		// Token: 0x04000781 RID: 1921
		public bool createFirstPointOnParticleBirth;

		// Token: 0x04000782 RID: 1922
		public bool createLastPointOnParticleDeath;

		// Token: 0x04000783 RID: 1923
		public bool multithreading = true;

		// Token: 0x04000784 RID: 1924
		[HideInInspector]
		public PlaygroundEventC birthEvent;

		// Token: 0x04000785 RID: 1925
		[HideInInspector]
		public PlaygroundEventC deathEvent;

		// Token: 0x04000786 RID: 1926
		[HideInInspector]
		public PlaygroundEventC collisionEvent;

		// Token: 0x04000787 RID: 1927
		protected List<ParticlePlaygroundTrail> _trails = new List<ParticlePlaygroundTrail>();

		// Token: 0x04000788 RID: 1928
		protected Transform _parentTransform;

		// Token: 0x04000789 RID: 1929
		protected GameObject _parentGameObject;

		// Token: 0x0400078A RID: 1930
		protected Material _materialCache;

		// Token: 0x0400078B RID: 1931
		protected float _calculationStartTime;

		// Token: 0x0400078C RID: 1932
		protected int _currentParticleCount;

		// Token: 0x0400078D RID: 1933
		protected float _currentParticleMinLifetime;

		// Token: 0x0400078E RID: 1934
		protected float _currentParticleMaxLifetime;

		// Token: 0x0400078F RID: 1935
		protected bool _localSpace;

		// Token: 0x04000790 RID: 1936
		protected Vector3 _billboardTransformPosition;

		// Token: 0x04000791 RID: 1937
		protected object _locker = new object();

		// Token: 0x04000792 RID: 1938
		protected bool _isDoneThread = true;

		// Token: 0x04000793 RID: 1939
		protected Matrix4x4 _localMatrix;

		// Token: 0x04000794 RID: 1940
		protected readonly Queue<TrailParticleInfo> _birthQueue = new Queue<TrailParticleInfo>();
	}
}
